﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TemplateAdmin.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="AirlineProject.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Flight
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<table class="listing" cellpadding="0" cellspacing="0" width="30">
					<tr>
						
						<th>Origin</th>
						<th>Destination</th>
						<th>Departure Date</th>
						<th>Flight Price</th>
						<th>Seat Num</th>
                        <th>Option</th>
                        
					</tr>
					
                    <%
                        FlightModels fm = new FlightModels();
                        List<Flight> fl = fm.ListFlight();
                        foreach(Flight ds in fl)
                        {
                         %>
                        <tr>
                     
						<td><%= ds.Orgin.place_name %></td>
						<td><%= ds.Destination.place_name %></td>
						<td><%= ds.departure_date %></td>
						<td><%= ds.flight_price %></td>
						<td><%= ds.seat_num %></td>
                        <td><a href="<%=Url.Action("addflight","Add") %>"><img src="../../../../Content/admin/images/user_add.png"  title="Add New" width="16" height="16" /></a><a href="<%= Url.Action("editflight/"+ds.flight_id,"edit") %>"><img src="../../../../Content/admin/images/user_edit.png" title="Edit Flight" width="16" height="16" /></a><a href="<%= Url.Action("deleteflight/"+ds.flight_id,"templateadmin") %>"><img src="../../../../Content/admin/images/user_delete.png" title="Delete Flight" width="16" height="16" /></a></td>
                        </tr>
        
                      <%  }%>
        
					
				</table>


</asp:Content>
